s = "a a "

import sys

s = s.rstrip()
if s == '':
    print(0)
s = list(s)
i = len(s) - 1
while i >= 0:
    if s[i] == ' ':
        s = s[i + 1:]
        print(len(s))
        sys.exit(0)
    i = i - 1
